package com.yuan.java.thread.schedulethread;

import java.util.UUID;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * @author yuaneg 2018/12/17
 */
public class ScheduleTest {


    public static void main(String[] args) {
        ScheduledExecutorService scheduledExecutorService = Executors.newSingleThreadScheduledExecutor();
        scheduledExecutorService.scheduleWithFixedDelay(() -> System.out.println(UUID.randomUUID().toString()), 1, 1, TimeUnit.SECONDS);
    }

}
